import unittest
from testtest import ShoppingList
class TestShoppingList(unittest.TestCase):
    #创建测试对象
    def setUp(self):
        self.shopping_list = ShoppingList({"牙刷":5,"毛巾":5,"牙膏":10})

    def test_get_item(self):
        self.assertEqual(self.shopping_list.get_item(),3)

    def test_get_total_price(self):
        self.assertEqual(self.shopping_list.get_total_price(),20)

